package com.barry;

import com.barry.excel.MyFun;
import jxl.Workbook;
import jxl.write.WritableWorkbook;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

/**
 * @ClassName Test2
 * @Description TODO
 * @Author wangxuexing
 * @Date 2020/2/20 17:40
 * @Version 1.0
 */
public class Test2 {
    public static void main(String[] args) {
        write1();
    }

    public static void write1(){
        try{
          /*  File filePath = new File("C:\\data\\projects\\bak\\easyexcel\\target\\test-classes\\templateWrite1582188645007.xlsx");
            InputStream in=new FileInputStream(filePath);
            Workbook wb = Workbook.getWorkbook(in);
// 打开一个文件的副本，并且指定数据写回到原文件
            WritableWorkbook wwb = Workbook.createWorkbook(filePath,wb);
            wwb.removeSheet(0); //wwb.removeSheet(i);i可以填数字,只要不大于工作表数就可以
            wwb.write();//将缓存数据写入
//关闭工作薄对象
            wwb.close();
            wb.close();*/
            Long t1 = 1L;
            Long t2 = 2L;
            op(t1, t2, (x,y)->x+y);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    public static void op(Long t1, Long t2, MyFun<Long, Long> mf2) {
        System.out.println(mf2.getValue(t1, t2));
    }
}
